<template>
  <!-- router两种跳转方式 -->
   <!-- npm install vue-router@next -->
  <button @click="() => router.push({ path: '/home', params: { id: 1 } })">首页</button>
  <button @click="() => router.push({ path: '/mine', query: { id: 2 } })">个人中心</button>
  <router-link to="/home">首页</router-link>
  <router-link to="/mine">个人中心</router-link>
  <router-view />
</template>

<script setup lang="ts">
import { useRouter, useRoute } from 'vue-router';
const router = useRouter()
const route = useRoute()
console.log('route', route.params, route.query)
</script>

<style scoped></style>
